<?php
/**
 * The loop that displays a page.
 *
 * The loop displays the posts and the post content. See
 * http://codex.wordpress.org/The_Loop to understand it and
 * http://codex.wordpress.org/Template_Tags to understand
 * the tags used in it.
 *
 * This can be overridden in child themes with loop-page.php.
 *
 * @package WordPress
 * @subpackage Twenty_Ten
 * @since Twenty Ten 1.2
 */
?>

<?php // The Query
$the_query = new WP_Query( array('post_type'=>'rpvideo','posts_per_page'=>'-1' ) );


?>
<div class="group">
<?php
// The Loop
while ( $the_query->have_posts() ) : $the_query->the_post(); 

?>

	<div class="video_image left">
		<div class="video_title text_center"><?php the_title(); ?></div>
		<a href="http://www.youtube.com/embed/<?php echo cc_get_youtube_code();?>?rel=0&wmode=transparent" class="youtube" title="<?php the_title(); ?>">
			<?php
				if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
					the_post_thumbnail();
				}
			else{ 
			?>
				<img src="http://img.youtube.com/vi/<?php echo cc_get_youtube_code();?>/hqdefault.jpg" alt="adero media video" />
			<?php } ?>
		</a>
	</div>

<?php 
endwhile; // end of the loop. 
?>
</div>
<?php
wp_reset_postdata();
?>
